package service

import (
	"context"

	pb "fgo/advance/grpc/grpc-gateway/sample/api"
)

// 定义helloHttpService并实现约定的接口
type HelloService struct{}

func (h HelloService) SayHelloHttp(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {
	resp := new(pb.HelloReply)
	resp.Message = "Hello " + in.Name + "."

	return resp, nil
}

func (h HelloService) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {
	resp := new(pb.HelloReply)
	resp.Message = "Hello " + in.Name + "."

	return resp, nil
}
